﻿using System;
using ITViet.Domains;
using ITViet.Services;
using ITViet.Web.App_Code;

namespace ITViet.Web.Pages
{
  public partial class ContactPage : BasePage
  {
    #region Properties
    private string CPType
    {
      get
      {
        string type = Request.QueryString["cpType"];
        return string.IsNullOrEmpty(type) ? ContactPageType.OnlineContact : type;
      }
    }
    #endregion

    #region Events
    protected void Page_Load(object sender, EventArgs e)
    {
      if (!IsPostBack && !IsCallback)
      {
        LoadInfo();
      }
    }
    #endregion

    #region Methods
    private void LoadInfo()
    {
			ContactInfo contactInfo;
			TList<ContactInfo> cList = new ContactInfoService().GetByTypeAndLanguage(ContactType.CompanyAddress, CurrentLanguage.Id, true);
			if (cList.Count > 0)
			{
				contactInfo = cList[0];
				ltrAddress.Text = contactInfo.Value;
			}

			//TList<ContactInfo> mapList = new ContactInfoService().GetByTypeAndLanguage(ContactType.ViewMap, CurrentLanguage.Id, true);
			//if (mapList.Count > 0)
			//{
			//  aViewMap.Attributes["onclick"] = "gotoWebsite('" + mapList[0].Value + "')";
			//}
    }
    #endregion
  }
}
